package com.ego.controller;

import com.ego.commons.pojo.EgoResult;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Title
 * @Author Lyg
 * @Description:
 */
@Controller
public class PageController {
    /**
     * 登录页面
     * @return
     */
//    @GetMapping("/")
    @RequestMapping("/")
    public String login(){
        System.out.println("执行控制器");
        return "login";
    }
    /**
     * 显示主页面
     * @return
     */
@RequestMapping("/main")
    public String index(){
        return "index";
    }
    /**
     * 登录成功跳转页面
     * @return
     */
    @RequestMapping("/loginSuccession")
    @ResponseBody
    public EgoResult loginSuccess(){
        return EgoResult.ok();
    }

    @RequestMapping("/{page}")
    public  String showpage(@PathVariable String page){
        return page;
    }

    //跳转到编辑（修改）页面
    @RequestMapping("/rest/page/item-edit")
    public String  itemEdit(){
        return "item-edit";
    }
}
